home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: phcoms4.seri.philips.nl!newssvr!news
- From: heydenj@bothrops.natlab.research.philips.com (Heijden van der J.)
- Subject: Re: Class
- Sender: news@natlab.research.philips.com (USENET News System)
- Message-ID: <HEYDENJ.96Mar4095800@bothrops.natlab.research.philips.com>
- In-Reply-To: jtbell@presby.edu's message of Sun, 3 Mar 1996 18:10:40 GMT
- Date: Mon, 4 Mar 1996 08:58:00 GMT
- References: <4hchoh$ngh@nova.umuc.edu> <DnpEHt.BH3@presby.edu>
- Organization: Philips Semiconductors B.V.
-
- But still...
-
- <snip>
-
- > >3. Is this the right way to right a file for a class in unix:
- > >
- > > //FILE: EmpRecords.h
- > > // MANIPULATES EMPLOYEE RECORDS
- > > #ifdef EMPLOYEERECORDS_H_
- ^^^^^
- should be ifndef instead!!!!
- > > #define EMPLOYEERECORDS_H_
- > >
- > > // class definition, and member function definitions
- > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ <-- NO!
- > > #endif//end of EmpRecords.h
- >
-
- The #ifndef / #define / #endif is used to prevent a single header to be
- included more then once (a header file might already be included in one of
- the other header files you include. A flag (EMPLOYEERECORDS_H_ in
- this case) is used to denote that a header file has been included. If this
- flag is not set (#ifndef), the definitions in the header are processed, AND the flag
- is set for further use (#define...) . If an attempt is made to include the header again,
- then the whole thing is skipped because of the #ifndef.
-
- Just my $0.02 worth...
- Jos.
-
- --
- J.W.B. van der Heijden, Philips Research Laboratories, Building WAY5.43
- Prof. Holstlaan 4 5656 AA Eindhoven The Netherlands
- Phone: +31-40-2744351 E-mail: heydenj@natlab.research.philips.com
- --
-
- J.W.B. van der Heijden, Philips Research Laboratories, Building WAY5.43
- Prof. Holstlaan 4 5656 AA Eindhoven The Netherlands
- Phone: +31-40-2744351 E-mail: heydenj@natlab.research.philips.com
-